
package dieci.hibernate;

import dieci.database.PersistentObject;
import dieci.system.OrderDetails;

/**
 *
 * @author DuckSys
 */
public class HibOrderDetails implements PersistentObject{

    private HibOrderDetailId id;
    private int amount;
    private double cost;

    public HibOrderDetails()
    {
    }

    public HibOrderDetails(OrderDetails details, Long orderId)
    {
        id = new HibOrderDetailId();
        id.setOrderId(orderId);
        id.setProductId(details.getProductId());
        this.amount = details.getAmount();
        this.cost = details.getCost();
    }

            /**
     * Get the value of cost
     *
     * @return the value of cost
     */
    public double getCost()
    {
        return cost;
    }

    /**
     * Set the value of cost
     *
     * @param cost new value of cost
     */
    public void setCost(double cost)
    {
        this.cost = cost;
    }

    
    /**
     * Get the value of amount
     *
     * @return the value of amount
     */
    public int getAmount()
    {
        return amount;
    }

    /**
     * Set the value of amount
     *
     * @param amount new value of amount
     */
    public void setAmount(int amount)
    {
        this.amount = amount;
    }

    /**
     * Get the value of details
     *
     * @return the value of details
     */
    public HibOrderDetailId getId()
    {
        return id;
    }

    /**
     * Set the value of details
     *
     * @param details new value of details
     */
    public void setId(HibOrderDetailId id)
    {
        this.id = id;
    }

}
